From b7b606b3a2a34b6c291c270932501b500cefc31e Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 19 Oct 2012 14:02:39 +1100 Subject: [PATCH] Clear $this->mOptionsLoaded in User::clearInstanceCache() (bug 41198) If clearInstanceCache() is to clear cached user data apart from the data from the user table, as addToDatabase() expects, then $this->mOptionsLoaded needs to be set to false. Clearing $this->mOptions may reduce memory usage a bit, but is not sufficient. Change-Id: I6912415dc154d06f62839a1ee777c2c3747253d6 --- includes/User.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/User.php b/includes/User.php index 809c18385c..0a02dd2b88 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1168,7 +1168,9 @@ class User { } /** - * Clear various cached data stored in this object. + * Clear various cached data stored in this object. The cache of the user table + * data (i.e. self::$mCacheVars) is not cleared unless $reloadFrom is given. + * * @param $reloadFrom bool|String Reload user and user_groups table data from a * given source. May be "name", "id", "defaults", "session", or false for * no reload. @@ -1182,6 +1184,7 @@ class User { $this->mEffectiveGroups = null; $this->mImplicitGroups = null; $this->mOptions = null; + $this->mOptionsLoaded = false; $this->mEditCount = null; if ( $reloadFrom ) { -- 2.20.1